/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pack;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Timer;
import net.useobjects.AbstractMovableRotatableGroup;
import net.useobjects.geom.Position;



public abstract class PohyblivyObjekt extends ValidaciaPremiestnenia {
        protected int delay = 50;

    protected Timer timer;
//    private int delay= 10;
    
    
    public PohyblivyObjekt(AbstractMovableRotatableGroup parent, Position pozicia) {
        super(parent, pozicia);
        timer = new Timer(delay,new TimerListener());
        timer.setRepeats(true);
        timer.start();
    }
    
      private class TimerListener implements ActionListener { // vnorena class

        @Override
        public void actionPerformed(ActionEvent e) {
            process();
        }

    }
    
    protected abstract void process();


}
